package top.lfyao.designpattern.details.command.example;

import java.util.ArrayList;
import java.util.List;

/**
 * 服务员
 */
public class Waiter {

    private List<MenuCommand> commands = new ArrayList<>();

    // 设置订单
    public void setOrder(MenuCommand command) {
        commands.add(command);
    }
    // 通知执行
    public void notifyCook() {
        for (MenuCommand command:commands)command.excuse();
    }
}
